package com.itheima.serviceimpl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.LoginDao;
import com.itheima.pojo.Member;
import com.itheima.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;


@Service(interfaceClass = LoginService.class)
@Transactional  //事务控制
public class LoginServiceimpl implements LoginService {

//    获取Dao层
    @Autowired
    private LoginDao loginDao;

    //根据手机号查询该用户是否为会员
    @Override
    public Member findMemberByPhone(String telephone) {
        Member member = loginDao.FindMemberByPhone(telephone);
        return member;
    }

    //添加会员
    @Override
    public void addMember(Member member) {
        loginDao.addMember(member);
    }
}
